﻿using MongoDB.Bson.Serialization.Attributes;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetCore6WebAPITestOneEntity
{
    /// <summary>
    /// 注册用户
    ///</summary>
    [SugarTable("userinfo")]
    public class UserinfoModel
    {
        /// <summary>
        ///  
        ///</summary>
        [SugarColumn(ColumnName = "UserID", IsPrimaryKey = true,IsIdentity =true)]
        public long UserID { get; set; }
        /// <summary>
        ///  
        ///</summary>
        [SugarColumn(ColumnName = "UserName")]
        public string UserName { get; set; }
        /// <summary>
        ///  
        ///</summary>
        [SugarColumn(ColumnName = "UserPwd")]
        public string UserPwd { get; set; }
        /// <summary>
        ///  
        ///</summary>
        [SugarColumn(ColumnName = "UserEmail")]
        public string UserEmail { get; set; }
        /// <summary>
        ///  
        /// 默认值: 1
        ///</summary>
        [SugarColumn(ColumnName = "IsValid")]
        public int IsValid { get; set; }
    }

    [BsonIgnoreExtraElements]
    public class UserinfoMongodbModel
    {
        /// <summary>
        ///  新增的时候不需要创
        ///</summary>
        public string UserID { get; set; }
        /// <summary>
        ///  
        ///</summary>
        [Required]
        public string UserName { get; set; }

        /// <summary>
        ///  
        ///</summary>
        [Required]
        public string UserPwd { get; set; }

        /// <summary>
        ///  
        ///</summary>
        public string UserEmail { get; set; }

        /// <summary>
        ///  
        /// 默认值: 1
        ///</summary>
        public int IsValid { get; set; }


        public DateTime CreateTime { get; set; }


        public DateTime UpdateTime { get; set; }
    }
}
